Skip to content

feat(tokens): add editorial typography family#1940

Merged
OneHunnid merged 5 commits into
mainfrom
worktree-editorial-typography-rollout
Jun 29, 2026
Merged

feat(tokens): add editorial typography family#1940
OneHunnid merged 5 commits into
mainfrom
worktree-editorial-typography-rollout

Conversation

@OneHunnid

@OneHunnid OneHunnid commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a Sora-based editorial typography token family for brand-themed surfaces (empty states, hero moments, announcements) that need the marketing-site type system rather than the utility scale.

Proposal: Editorial Typography Tokens — LaunchPad proposal (Phase 1 only; Phase 2 is a separate gonfalon PR for the Sora global preload).

What's in

  • fontFamily.sora with an Inter fallback so surfaces rendering before the Sora @font-face resolves (or in the authenticated bundle before Phase 2 ships) drop cleanly to LaunchPad's base sans-serif.
  • fontSize.editorial.{14..80} rungs — pixel-named to match the size primitives. The original proposal used 100/200/.../1300 step rungs but style-dictionary's CSS font-shorthand emitter mis-tokenizes 4-digit rung names starting with 1 (it splits e.g. 1300 into a synthetic line-height reference + trailing digits). Pixel-value names avoid the bug and are self-documenting.
  • fontWeight.editorial.{medium,semibold,bold} namespace — 500/600/700 mirroring the brand DEFAULT_WEIGHT map in ai-refresh/components/Text/index.tsx.
  • lineHeight.editorial.{tight,snug,close,default,relaxed} — unitless multipliers (1, 1.05, 1.1, 1.15, 1.5) per _typography.scss.
  • letterSpacing — brand-new top-level token group with editorial.* sub-namespace. Consumers apply this alongside the --lp-text-editorial-* shorthand since CSS font shorthand does not include letter-spacing.
  • 7 text.editorial.* compositions — display, h1, h1-alt, h2, h2-alt, h2-medium, h3. Sora-only; Söhne mixins deferred pending Klim licensing.
  • size.30 and size.50 primitives added to size.json.

Source of truth

All numeric values mirror _typography.scss and the DEFAULT_WEIGHT map from launchdarkly-nextjs/ai-refresh.

Verification

  • pnpm build passes
  • All 7 typography compositions emit clean CSS shorthand (e.g. --lp-text-editorial-display: var(--lp-font-weight-editorial-bold) var(--lp-font-size-editorial-80)/var(--lp-line-height-editorial-tight) var(--lp-font-family-sora);)
  • stories/typography.stories.tsx is data-driven via flatten(vars.text) — editorial tokens appear automatically in Storybook with no code change

Test plan

  • Storybook renders the 7 new editorial tokens under Tokens/Typography
  • Empty-state mock using var(--lp-text-editorial-h1) + var(--lp-letter-spacing-editorial-tight-em-05) renders at 64px Sora Bold with -0.05em tracking
  • No regression on existing text.heading.*, text.body.*, text.display.* compositions (no token references changed)
  • Visual specimen sign-off in Utility vs Editorial Typography Sets Figma file

Follow-ups (not in this PR)

  • Register Figma text styles in 🚀 LaunchPad under a new "Editorial" section
  • Phase 2: gonfalon PR to move Sora @font-face + preload out of the unauthenticated bundle gate (planned as a fairytale-gated guarded rollout)

via LD Research 🤖


Note

Low Risk
Additive design tokens and a small Box typing fix; no changes to existing utility typography or security-sensitive code.

Overview
Introduces a Sora-based editorial typography token set for brand moments (empty states, heroes, announcements), aligned with ai-refresh _typography.scss. New primitives include fontFamily.sora (Inter fallback), nested fontSize / fontWeight / lineHeight / letterSpacing editorial namespaces, size.30 and size.50, and seven text.editorial.* compositions (display through h3 variants). Existing utility text.* tokens are not modified.

@launchpad-ui/box flattens fontSize, fontWeight, and lineHeight in rainbow-sprinkles (like font already) so nested editorial.* keys work with defineProperties typing.

Storybook loads Sora from Google Fonts for specimens only (in-product font preload is deferred). Typography docs split into Utility and Editorial stories with editorial-aware labels and semantic heading tags.

Reviewed by Cursor Bugbot for commit e222427. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a Sora-based editorial typography token family for brand-themed
surfaces (empty states, hero moments, announcements) that need the
marketing-site type system rather than the utility scale.

- New `fontFamily.sora` with Inter fallback
- New `fontSize.editorial.{14..80}` rungs (pixel-named to match size
  primitives; avoids style-dictionary CSS font-shorthand emitter
  mis-tokenizing 4-digit rung names)
- New `fontWeight.editorial.{medium,semibold,bold}` namespace
- New unitless `lineHeight.editorial.{tight,snug,close,default,relaxed}`
- New top-level `letterSpacing` group with `editorial.*` sub-namespace
  (consumers apply alongside the typography shorthand since CSS font
  shorthand does not include letter-spacing)
- 7 new `text.editorial.*` compositions: display, h1, h1-alt, h2, h2-alt,
  h2-medium, h3 — Sora-only; Söhne mixins deferred pending licensing
- Adds `size.30` and `size.50` primitives required by the new scale

Source of truth: `_typography.scss` and `Text/index.tsx` DEFAULT_WEIGHT
map in launchdarkly-nextjs/ai-refresh.

Phase 2 (gonfalon Sora global preload + fairytale rollout) lands in a
separate PR — see Editorial Typography Tokens proposal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@OneHunnid OneHunnid requested review from a team as code owners June 24, 2026 17:06
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e222427

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@launchpad-ui/tokens Minor
@launchpad-ui/box Patch
launchpad-design-system Patch
@launchpad-ui/button Patch
@launchpad-ui/components Patch
@launchpad-ui/drawer Patch
@launchpad-ui/dropdown Patch
@launchpad-ui/filter Patch
@launchpad-ui/form Patch
@launchpad-ui/icons Patch
@launchpad-ui/menu Patch
@launchpad-ui/modal Patch
@launchpad-ui/navigation Patch
@launchpad-ui/popover Patch
@launchpad-ui/table Patch
@launchpad-ui/tooltip Patch
@launchpad-ui/vars Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 24, 2026

Copy link
Copy Markdown
yarn add https://pkg.pr.new/@launchpad-ui/components@1940.tgz
yarn add https://pkg.pr.new/@launchpad-ui/icons@1940.tgz
yarn add https://pkg.pr.new/@launchpad-ui/tokens@1940.tgz

commit: e222427

@nhironaka nhironaka left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to update storybook to demonstrate the new font?

Replaces the single Typography story with two stories so each section
renders with its own heading and description above its own canvas.
Custom docs page (Title + Description + Stories with includePrimary
and no section title) skips the default Primary canvas and removes
the "Stories" separator heading.

Editorial label rendering: getDisplayText now handles editorial keys
by expanding h1/h2/h3 to "Heading 1/2/3" with alt and medium kept as
variant suffixes. Component description mentions the two type sets
and links to the Utility & Editorial Type System proposal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1316c55. Configure here.

Comment thread packages/tokens/stories/typography.stories.tsx
@OneHunnid

Copy link
Copy Markdown
Contributor Author

@nhironaka Yes, I updated StoryBook in the second commit on this branch.

@nhironaka

Copy link
Copy Markdown
Contributor

Storybook now demonstrates the actual Sora editorial type instead of
silently falling back to Inter: the Editorial specimens render with
font-family var(--lp-font-family-sora) ("Sora, Inter, ..."), but no
Sora webfont was loaded in the preview, so they rendered in Inter.

- preview-head.html: load Sora from Google Fonts (OFL) for Storybook
  specimens only. The in-product @font-face/preload ships in Phase 2
  (gonfalon), so this stays scoped to the docs surface.
- typography.stories.tsx: map editorial-h1/h2/h3 to real h1/h2/h3 tags
  in getSemanticElement (previously fell through to a generic div);
  drop a stray per-token console.log.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@OneHunnid

Copy link
Copy Markdown
Contributor Author

@nhironaka

do we need to update storybook to demonstrate the new font?

Good catch — we did, and it wasn't actually showing Sora. The Editorial specimens render with font-family: var(--lp-font-family-sora) ("Sora, Inter, …"), but nothing loaded the Sora webfont in the Storybook preview (preview-head.html only preloads Audimat + Inter, and there's no Sora $type: file entry in asset.json since the in-product @font-face is deferred to Phase 2). So every Editorial token was silently falling back to Inter.

Pushed ab50d90:

  • preview-head.html now loads Sora from Google Fonts (OFL-licensed, reuses the existing fonts.gstatic.com preconnect). Scoped to Storybook only — it doesn't ship Sora in the product bundle, so it stays consistent with the Phase 2 gonfalon work for the in-app @font-face/preload.
  • Also fixed the Cursor bot finding in the same file: editorial-h1/h2/h3 now render as real h1/h2/h3 instead of falling through to a generic div.

Editorial specimens now render in actual Sora.

OneHunnid and others added 2 commits June 29, 2026 13:41
…angeset

The editorial typography tokens nest an `editorial.*` sub-namespace under
fontSize, fontWeight, and lineHeight. Box's rainbow-sprinkles passed these
groups straight into defineProperties, which expects a flat
Record<string, string>, so the nested objects broke its overload typing —
cascading into BoxProps and every <Box> consumer (preview, stories, specs)
failing Type Check.

Flatten those three groups via `flat` (the same treatment the `font`
typography group already gets), so editorial.* tokens become flat keys and
defineProperties typing holds. Also adds the missing changeset for the
@launchpad-ui/tokens + @launchpad-ui/box changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@OneHunnid OneHunnid merged commit ccc97d8 into main Jun 29, 2026
19 checks passed
@OneHunnid OneHunnid deleted the worktree-editorial-typography-rollout branch June 29, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants